import service from "@/utils/request";

export function getContestListService(contestQueryDTO) {
  return service({
    url: "/contest/semiLogin/redis/list",
    method: "get",
    params: contestQueryDTO
  });
}

export function getContestRankListService(params) {
  return service({
    url: "/contest/rank/list",
    method: "get",
    params,
  });
}

export function enterContestService(enterContestDTO) {
  return service({
    url: "/user/contest/enter",
    method: "post",
    data: enterContestDTO,
  });
}

export function getMyContestListService(params = {}) {
  return service({
    url: "/user/contest/list",
    method: "get",
    params,
  });
}

export function getContestFirstQuestionService(contestId) {
  return service({
    url: "/contest/getFirstQuestion",
    method: "get",
    params: { contestId },
  });
}

export function contestPreQuestionService(contestId, questionId) {
  return service({
    url: "/contest/preQuestion",
    method: "get",
    params: { contestId,questionId},
  });
}

export function contestNextQuestionService(contestId, questionId) {
  return service({
    url: "/contest/nextQuestion",
    method: "get",
    params: { contestId, questionId },
  });
}